


import store from '@/store'

/**
 * 显示隐藏按钮
 */
function checkPermission(el, binding, vnode) {
  const isAdmin = store.getters && store.getters.isAdmin
  if (!isAdmin) {
    el.parentNode && el.parentNode.removeChild(el)
  }
}

export default {
  inserted(el, binding) {
    checkPermission(el, binding)
  },
  update(el, binding) {
    checkPermission(el, binding)
  }
} 